-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for aten::randperm and aten::polar #29585
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvafin
I found out that pytorch.polar returns complex tensors meanwhile OpenVINO does not support them right now
to make it work, I separately computed real and imag parts using cos and sine then wrapped it with a ComplexTypeMark.
I will now work on str and delete
Also please fix code style
|
thank you for the insight, I updated the model to use randperm and sort it within the model itself to use the test function I also separated the sin and cos for easier reading |
device=x.device, pin_memory=False) | ||
else: | ||
raise ValueError("Invalid num_inputs") | ||
sorted_p, _ = torch.sort(p) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea was to use randperm output to permute the actual tensor. BTW, x
can be such tensor, otherwise it is unused variable here, and sort the tensor after permutation to verify that permutation works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alright, I updated it so that randperm's o/p shuffles the actual tensor, and then sorts it
please check
Co-authored-by: Maxim Vafin <maxim.vafin@intel.com>
now it can handle value of n dynamically
@mvafin |
atol = 1e-4 if precision == "FP32" else 1e-3 | ||
rtol = 1e-4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
atol = 1e-4 if precision == "FP32" else 1e-3 | |
rtol = 1e-4 |
you are not using atol
and rtol
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, I have removed them now, I was initially using atol and rtol as I was worried about the floating point differences that might be produced, but the default test layer handles it fine!
added a comment to explain why we sort
build_jenkins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. Everything seems to be okay now.
@mvafin Thank you very much for your patience and feedback throughout the process I appreciate the valuable insights gained and will apply them to my future PRs |
Hi @mvafin, are there any issues with the merging? |
Don't worry about this. That is cause by the issues in our CI, I will look into it. |
ah, alright, thanks for the update. |
build_jenkins |
Details:
added support for aten::randperm and tests
currently working on aten::polar and others
Tickets: